package zhr.chapter7;

import java.util.Random;

public class Example7_8 {
    public static void main(String[] args) {
        String yzmStr = "0123456789abcdefghijklmnopqrstuvwxyz";
        StringBuilder sBuilder = new StringBuilder(4);
        char[] yzmArr = yzmStr.toCharArray();
        Random rand = new Random();
        for ( int i = 0; i < 10; i++ ) {
            for ( int j = 0; j < 4; j++ ) {
                int pos = rand.nextInt(36);
                sBuilder.append(yzmArr[pos]);
            }
            System.out.println("第"+ i +"个验证码为："+sBuilder);
            sBuilder.delete(0,4);
        }
    }
}
